package pe.com.empresa.utiles;

import java.sql.SQLException;
import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

public interface IServiceHelper {
	
	void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory);
	SqlSession getSession();
	void openSession() throws SQLException;
	void closeSession() throws SQLException;
	
	void actualizar(Object object) throws Exception;

	void insertar(Object object) throws Exception;

	@SuppressWarnings("rawtypes")
	void eliminar(Class mapperClass, Object obj) throws Exception;

	void commit() throws SQLException;

	void rollback() throws SQLException;
	@SuppressWarnings("rawtypes")
	public Object selectByPrimaryKey(Class mapperClass, String id)throws Exception;
	
	@SuppressWarnings("rawtypes")
	List selectByCriteria(String nomMapper,String nomQuery, Criteria criteria);
	@SuppressWarnings("rawtypes")
	List selectByCriteria(String nomQuery, Criteria criteria);
}
